package net.lsr.demo.task;

import net.lsr.demo.service.QrcodeService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * desc: 生成二维码任务
 * @author lsr
 * @version 2014年6月4日
 */
@Component
public class GenerateQrcodeTask {
	private static final Logger logger = LoggerFactory.getLogger(GenerateQrcodeTask.class);
	@Autowired
	private QrcodeService qrcodeService;
	
	@Scheduled(cron = "0 0 1 * * ?")
	public void process() throws Exception{
		logger.info("generate qrcode...");
		// 每天凌晨1点生成签到二维码
		qrcodeService.generateQrcode();
	}
}
